package enumzb;

/**
 * @author wzby
 * @Date: 2022/8/11 14:22
 */
public enum MessageEnum {
    SAVE(100,"保存"),
    DELETE(200,"删除"),
    OPEN(300,"打开"),
    START(400,"开始"),
    ERROR(500,"错误");
    private int code;
    private String message;

    MessageEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
    public static MessageEnum froTypeCode (int code){
        for (MessageEnum type : MessageEnum.values()){
            if ( type.code == code){
                return type;
            }
        }
        return null;
    }
}
